<body>
	<form onsubmit="onFormSubmit()">
		<input name="txt" value="text" />
		<input id="btn" type="button" value="Invoke Submit" onclick="this.form.submit(); return false; " />
		<input type="submit" value="Direct Submit" />
	</form>
	
	<script>
		
		function onFormSubmit()
		{
			alert("submitting...");
		}
		var originalSubmit = document.forms[0].submit;
		document.forms[0].submit = function(){ onFormSubmit(); originalSubmit(); };
		
		var originalClick = document.getElementById('btn').click;
		document.getElementById('btn').click = function(){ alert("clicking..."); originalClick(); };
	</script>
</body>